package com.liu.repository;

import com.liu.domain.VoteTopic;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;

/**
 * Created by liu on 17-10-27.
 */
public interface VotetopicRepository extends JpaRepository<VoteTopic,Integer> {

    @Query("select v from VoteTopic v where v.stopTime >= ?1")
    List<VoteTopic> isOut(Date date);

    @Query("select v from VoteTopic v where v.startTime <= ?1")
    List<VoteTopic> isStart(Date date);               //开始的时间 暂时不用


    @Query("select t from VoteTopic t order by t.stopTime desc ")
    public List<VoteTopic> findBytime();                 //
}

